<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bank</title>

    <script src="/js/jquery.min.js"></script>
</head>
<body>
<div id="header">

</div>
<div id="function">
    <form action="kucunpandian.do">
        <table border="1">
            <tr><th>货主</th><th><input type="text" name="custName" id="huozhu" th:value="${session.custName}"><br></th></tr>
            <tr><th>仓库</th><th><select name="storeName" id="storeName"><option th:each="i:${session.stringList}" th:value="${i}" th:text="${i}">--请选择--</option></select></th></tr>
            <tr><th></th><th><button type="submit">开始盘点</button></th></tr>
        </table><br>
        每页显示条数<select name="pageRows" id="pageRows" onchange="change(this.value)">
        <option th:each="a:${session.list1}" th:value="${a}" th:text="${a}" th:selected="${session.pageRows==a}"></option>
    </select>&nbsp;&nbsp;&nbsp;
        第<label th:text="${session.pageInfo1.getPageNum()}"></label>页
        <input type="hidden" th:value="${session.pageInfo1.getPageNum()}" id="pageNum">
    </form>
        <label th:if="${session.pageInfo1.size==0}" style="color: aquamarine">没有查到任何数据!请输入要查询的信息</label>
        <table id="table" border="1" th:if="${session.pageInfo1.size!=0}">
            <tr><td>仓库名称</td><td>货主</td><td>仓位</td><td>托盘</td><td>货物名称</td><td>货物规格</td><td>当前数量</td></tr>
            <tr th:each="every:${session.pageInfo1.getList()}">
                <td th:text="${every.storName}"></td>
                <td th:text="${every.custName}"></td>
                <td th:text="${every.siteID}"></td>
                <td th:text="${every.trayID}"></td>
                <td th:text="${every.detailsGoodsName}"></td>
                <td th:text="${every.detailsGoodsSpec}"></td>
                <td th:text="${every.detailsGoodsNum}"></td>
            </tr>
            <tr>
                <button th:value="${session.pageInfo1.getPageNum()>1?session.pageInfo1.getPageNum()-1:session.pageInfo1.getPageNum()}" onclick="nextpage(this.value)">上一页</button>
                <button th:value="${session.pageInfo1.getPageNum()<session.pageInfo1.getPages()?session.pageInfo1.getPageNum()+1:session.pageInfo1.getPageNum()}" onclick="nextpage(this.value)">下一页</button>
            </tr>

        </table>
</div>
<div id="copyright">
    版权区
</div>
</body>

    <script type="text/javascript">
        function change(row) {
            var custName=$("#huozhu").val();
            var storeName=$("#storeName").val();
            var pageNum=$("#pageNum").val();
            window.location="kucunpandian.do?pageNum="+pageNum+"&pageRows="+row+"&custName="+custName+"&storeName="+storeName;
        }
        function nextpage(page) {
            var custName=$("#huozhu").val();
            var storeName=$("#storeName").val();
            var pageRows=$("#pageRows").val();
            window.location="kucunpandian.do?pageNum="+page+"&pageRows="+pageRows+"&custName="+custName+"&storeName="+storeName;
        }
    </script>
</html>